package yanc.app

class User {
    String userId
    String account //账号用户名
    String name //姓名
    String password
    String telephone //手机号
    String gender  //0 男 1 女 2 未知
    String email
    String age
    String job
    String address //地址
    Date lastime
    Integer times
    String rolesId
    Boolean state

    /**
     * 映射。
     */
    static mapping = {
        table "sys_user"
        version false
        userId(column: "user_Id", sqlType: "varchar(10)")
        account(column: "account", sqlType: "varchar(20)")
        name(column: "name", sqlType: "varchar(50)")
        password(column: "password", sqlType: "varchar(200)")
        telephone(column: "telephone", sqlType: "varchar(20)")
        gender(column: "gender", sqlType: "varchar(2)")
        email(column: "email", sqlType: "varchar(20)")
        age(column: "age", sqlType: "varchar(5)")
        address(column: "address", sqlType: "varchar(255)")
        job(column: "job", sqlType: "varchar(20)")
        lastime(column: "lastime", sqlType: "datetime")
        times(column: "times", sqlType: "int(4)", defaultValue: "'0'", insertable: false)
        rolesId(column: "rolesId", sqlType: "varchar(100)")
        state(column: "state", sqlType: "tinyint(1)", defaultValue: "1", insertable: false)
    }

    static constraints = {
        userId(nullable: false, blank: false, unique: true)
        account(nullable: false, unique: true)
        name(nullable: true, unique: false)
        password(nullable: false, unique: false)
        telephone(nullable: true, unique: false)
        gender(nullable: true, unique: false)
        email(nullable: true, unique: false)
        job(nullable: true, unique: false)
        age(nullable: true, unique: false)
        address(nullable: true, unique: false)
        lastime(nullable: true, unique: false)
        times(nullable: true, blank: false, unique: false)
        rolesId(nullable: true, unique: false)
        state(nullable: true, blank: false, unique: false)
    }
}
